using System;
using System.Collections.Generic;
using System.Text;

namespace PeDALS.Tools.AZ.PSTArchive
{
    /// <summary>
    /// This is used to notify the progress of the Execute method
    /// </summary>
    /// <param name="sender">A reference to the plug-in the fired the event.</param>
    /// <param name="e">The <see cref="ProgressEventArgs"/> event arguments.</param>
    public delegate void ExecutionProgressEventHandler(object sender, ProgressEventArgs e);
    /// <summary>
    /// This delegate is used to signify the end of the Execute
    /// </summary>
    /// <param name="sender">A reference to the plug-in the fired the event.</param>
    /// <param name="e">The <see cref="CompletedEventArgs"/> event arguments.</param>
    public delegate void ExecutionCompleteEventHandler(object sender, CompleteEventArgs e);
    /// <summary>
    /// This is used to notify of an exception.
    /// </summary>
    /// <param name="sender">A reference to the plug-in the fired the event.</param>
    /// <param name="e">The <see cref="ExceptionEventArgs"/> event arguments.</param>
    public delegate void ExecutionExceptionEventHandler(object sender, ProgressEventArgs e);

    /// <summary>
    /// Defines an interface for the plug-in architecture.
    /// </summary>
    /// <remarks><img src="../images/ITaskPlugin.png" /></remarks>
    public interface iPlug
    {
        #region Public Properties

        #region Metadata

        /// <summary>
        /// The name of the plug-in.
        /// </summary>
        string Name { get;}
        /// <summary>
        /// The description of the plug-in.
        /// </summary>
        string Description { get;}
        /// <summary>
        /// Boolean to indicate if a profile definition is required for the plug-in.
        /// </summary>
        bool ProfileRequired { get;}
        /// <summary>
        /// The default PST profile for the plug-in.
        /// </summary>
        string DefaultProfile { get;}
        /// <summary>
        /// The version of the plug-in.
        /// </summary>
        string Version { get;}
        /// <summary>
        /// The author of the plug-in.
        /// </summary>
        string Author { get;}

        #endregion Metadata



        #endregion Properties

        #region Methods

        /// <summary>
        /// Executes the plug-in.
        /// </summary>
        /// <returns>void</returns>
        void Execute(string strPSTFilename, string strExportFolder, string strProfile, bool blnWriteMessageBinary, bool blnWriteAttachmentBinary);

        /// <summary>
        /// Cancels the execution of a plug-in
        /// </summary>
        /// <returns>void</returns>
        void Cancel();

        #endregion Methods

        #region Events

        /// <summary>
        /// This is used to notify plug-in host about the processing of the Execute Method.
        /// </summary>
        event ExecutionProgressEventHandler ExecutionProgress;
        /// <summary>
        /// This is used to notify plug-in host about the ending of the Execute Method.
        /// </summary>
        event ExecutionCompleteEventHandler ExecutionComplete;
        /// <summary>
        /// This is used to notify plug-in host about any Exceptions that have occurred.
        /// </summary>
        event ExecutionExceptionEventHandler ExecutionException;

        #endregion Events
    }
}
